  $(document).ready(function() {



        var dialog;  
         elRTE.prototype.options.panels.web2pyPanel = [
      'bold', 'italic', 'underline', 'forecolor', 'justifyleft', 'justifyright',
      'justifycenter', 'justifyfull', 'formatblock', 'insertorderedlist', 'insertunorderedlist',
      'link', 'image', 'flash'
  ];
  elRTE.prototype.options.toolbars.web2pyToolbar = ['web2pyPanel', 'tables'];
        var opts = {
           lang         : 'fr',   // set your language
           cssClass : 'el-rte',
           styleWithCSS : true,
           width: 334,
           height       : 400,
            toolbar      : 'web2pyToolbar',
            cssfiles : ['../css/editeur.css'],
         
            fmOpen: function(callback) {
                if (!dialog) {
                // create new elFinder
                dialog = $('<div />').dialogelfinder({
                            url: '../elfinder-2.0-rc1/php/connector.php',
                            commandsOptions: {
                                getfile: {
                                oncomplete : 'close' // close/hide elFinder
                                }
                            },
                            getFileCallback: callback // pass callback to file manager
                            });
                } else {
                    // reopen elFinder
                    dialog.dialogelfinder('open')
                }
            }
        };

        var editor = new elRTE(document.getElementById('contenu'), opts);
     //   $('.el-rte .workzone iframe').css('background-color','red');
        
});